# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $

DESCRIPTION="PIAVE - Piave Is A Video Editor"
HOMEPAGE="http://modesto.sourceforge.net/piave/index.html"
MY_P="${P}"
SRC_URI="mirror://sourceforge/modesto/${MY_P}.tar.gz"

IUSE="nls"
SLOT="0"
LICENSE="GPL-2"
KEYWORDS="x86"

S="${WORKDIR}/${P}"

DEPEND="virtual/x11
	>=dev-util/pkgconfig-0.15.0
	>=dev-libs/libxml2-2.5.11
	>=dev-cpp/libxmlpp-0.21.0
	>=media-libs/gdk-pixbuf-0.22.0
	>=media-libs/libsdl-1.2.6-r2
	>=media-libs/sdl-image-1.2.3
	>=media-libs/libdv-0.99-r1
	>=sys-libs/libraw1394-0.9.0
	>=sys-libs/libavc1394-0.4.1"

src_compile() {
	cd ${S}

	# Do some cleanup
	. clean

	# Here we patch to the current cvs-version
	# because the release 0.2.3 did not compile
	# on my system.
	#epatch ${FILESDIR}/cvs-031129.patch.gz
	cp -rv ${FILESDIR}/. ${S}/	

	# autotools from piave's bootstrap command
	export WANT_AUTOCONF_2_5=1
	einfo "calling aclocal"
	aclocal -I m4
	einfo "calling autoheader"
	autoheader
	einfo "calling automake --foreign --add-missing"
	automake --foreign --add-missing
	einfo "calling autoconf"
	autoconf

	myconf="--with-gnu-ld"
	use nls || myconf="${myconf} --disable-nls"
	econf ${myconf} || die "configure failed"
	emake || die
}

src_install() {
	make DESTDIR=${D} install || die
	dodoc AUTHORS ChangeLog README TODO
}
